package br.univali.compiladores.compilador;
import java.io.File;
import java.io.IOException;

public class Main {

	public static void main(String[] args) {
		File f = new File(System.getProperty("user.dir") + File.separator + "libs" + File.separator + "mv.jar");
	
		Process p;
		try {
			p = Runtime.getRuntime().exec("cmd /c start java -jar " + f.getAbsolutePath(), new String[]{
				"ALI 2","REA 1", "STR 1" , "REA 1", "STR 2", 
				"LDV 1", "LDV 2", "BGR 0", "JMF 13", "LDV 1", 
				"WRT 0", "JMP 15", "LDV 2", "WRT 0", "STP 0"
			});
		boolean terminou = false;
		while(!terminou){
			try{
				System.out.println(p.exitValue());
				terminou = true;
			} catch(Exception e){
				e.printStackTrace();
			}
		}
		} catch (IOException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}
	}

}
